package com.hpeng.sys.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.hpeng.sys.model.SysLogger;
import com.hpeng.sys.service.SysLoggerMgr;
import com.hpeng.util.Pagination;

@Component("SysLoggerAction")
@Scope("prototype")
public class SysLoggerAction {
	private String userCode;
	List<SysLogger> loggerList;
	@Resource
	private SysLoggerMgr sysLoggerMgr;
	private int page;
	private String pageLink;
	private  Pagination<SysLogger> pagination;
	
	
	
	public String getLogger(){
		loggerList = sysLoggerMgr.getLogger(this.userCode);
		
		String[] hql = {" from SysLogger s "};
		String values="";
		if(userCode != null && !userCode.equals("")){
			hql[0] += " where s.UserCode = '"+userCode+"' ";
		}
		pagination =sysLoggerMgr.getPagination(page, hql, values);
		pageLink = pagination.getPageLink("userLogger.action");
		return "success";
	}
	
	
	public List<SysLogger> getLoggerList() {
		return loggerList;
	}

	public void setLoggerList(List<SysLogger> loggerList) {
		this.loggerList = loggerList;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	
	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public String getPageLink() {
		return pageLink;
	}

	public void setPageLink(String pageLink) {
		this.pageLink = pageLink;
	}

	public Pagination<SysLogger> getPagination() {
		return pagination;
	}

	public void setPagination(Pagination<SysLogger> pagination) {
		this.pagination = pagination;
	}


}
